<?php
/**
 * Class was generated by WSDL2PHP tool
 * Timestamp: 1301913375 
 *
 * PHP version 5
 * 
 * @category tools
 * @package  WSDL
 * @author   Andrey Filippov <afi.work@gmail.com>
 * @license  %license%
 * @version  SVN: $Id: TemplateWebService.php 9 2007-12-25 11:26:03Z afi $
 * @link     https://solo-framework-lib.googlecode.com
 */

require_once "MonetaDataTypes.php";

class MonetaWebServiceConnector
{
	/**
	 * Mapping PHP classes and types from a WSDL
	 * Key - type defined in WSDL, value - PHP class name
	 * To avoid conflicts with another classes we have to add prefix for generated data types 
	 */
	private static $classmap = array(
			'Money' => 'MonetaMoney',
			'Description' => 'MonetaDescription',
			'Password' => 'MonetaPassword',
			'OperationStatus' => 'MonetaOperationStatus',
			'AccountId' => 'MonetaAccountId',
			'Currency' => 'MonetaCurrency',
			'AccountStatus' => 'MonetaAccountStatus',
			'AccountType' => 'MonetaAccountType',
			'CTID' => 'MonetaCTID',
			'ProfileType' => 'MonetaProfileType',
			'DocumentType' => 'MonetaDocumentType',
			'Email' => 'MonetaEmail',
			'TransactionRequestType' => 'MonetaTransactionRequestType',
			'TransactionBatchRequestType' => 'MonetaTransactionBatchRequestType',
			'TransactionResponseType' => 'MonetaTransactionResponseType',
			'TransactionBatchResponseType' => 'MonetaTransactionBatchResponseType',
			'OperationInfoBatchResponseType' => 'MonetaOperationInfoBatchResponseType',
			'AuthoriseTransactionRequestType' => 'MonetaAuthoriseTransactionRequestType',
			'AuthoriseTransactionBatchRequestType' => 'MonetaAuthoriseTransactionBatchRequestType',
			'ConfirmTransactionRequestType' => 'MonetaConfirmTransactionRequestType',
			'ConfirmTransactionBatchRequestType' => 'MonetaConfirmTransactionBatchRequestType',
			'CancelTransactionRequestType' => 'MonetaCancelTransactionRequestType',
			'CancelTransactionResponseType' => 'MonetaCancelTransactionResponseType',
			'CancelTransactionBatchRequestType' => 'MonetaCancelTransactionBatchRequestType',
			'CancelTransactionBatchResponseType' => 'MonetaCancelTransactionBatchResponseType',
			'ForecastTransactionResponseType' => 'MonetaForecastTransactionResponseType',
			'VerifyTransferResponseType' => 'MonetaVerifyTransferResponseType',
			'AccountInfo' => 'MonetaAccountInfo',
			'AccountAccessInfo' => 'MonetaAccountAccessInfo',
			'KeyValueAttribute' => 'MonetaKeyValueAttribute',
			'KeyValueApprovedAttribute' => 'MonetaKeyValueApprovedAttribute',
			'OperationInfo' => 'MonetaOperationInfo',
			'OperationInfoList' => 'MonetaOperationInfoList',
			'PagerPageNumber' => 'MonetaPagerPageNumber',
			'PagerPageSize' => 'MonetaPagerPageSize',
			'Pager' => 'MonetaPager',
			'Profile' => 'MonetaProfile',
			'Document' => 'MonetaDocument',
			'File' => 'MonetaFile',
			'AccountRelation' => 'MonetaAccountRelation',
			'InvoiceRequest' => 'MonetaInvoiceRequest',
			'InvoiceResponse' => 'MonetaInvoiceResponse',
			'TransferRequest' => 'MonetaTransferRequest',
			'TransferResponse' => 'MonetaTransferResponse',
			'TransferBatchRequest' => 'MonetaTransferBatchRequest',
			'TransferBatchResponse' => 'MonetaTransferBatchResponse',
			'AuthoriseTransactionRequest' => 'MonetaAuthoriseTransactionRequest',
			'AuthoriseTransactionResponse' => 'MonetaAuthoriseTransactionResponse',
			'AuthoriseTransactionBatchRequest' => 'MonetaAuthoriseTransactionBatchRequest',
			'AuthoriseTransactionBatchResponse' => 'MonetaAuthoriseTransactionBatchResponse',
			'ConfirmTransactionRequest' => 'MonetaConfirmTransactionRequest',
			'ConfirmTransactionResponse' => 'MonetaConfirmTransactionResponse',
			'ConfirmTransactionBatchRequest' => 'MonetaConfirmTransactionBatchRequest',
			'ConfirmTransactionBatchResponse' => 'MonetaConfirmTransactionBatchResponse',
			'CancelTransactionRequest' => 'MonetaCancelTransactionRequest',
			'CancelTransactionResponse' => 'MonetaCancelTransactionResponse',
			'CancelTransactionBatchRequest' => 'MonetaCancelTransactionBatchRequest',
			'CancelTransactionBatchResponse' => 'MonetaCancelTransactionBatchResponse',
			'RefundRequest' => 'MonetaRefundRequest',
			'RefundResponse' => 'MonetaRefundResponse',
			'ForecastTransactionRequest' => 'MonetaForecastTransactionRequest',
			'ForecastTransactionResponse' => 'MonetaForecastTransactionResponse',
			'VerifyTransactionRequest' => 'MonetaVerifyTransactionRequest',
			'VerifyTransactionResponse' => 'MonetaVerifyTransactionResponse',
			'VerifyTransferRequest' => 'MonetaVerifyTransferRequest',
			'VerifyTransferResponse' => 'MonetaVerifyTransferResponse',
			'FindAccountByIdRequest' => 'MonetaFindAccountByIdRequest',
			'FindAccountByIdResponse' => 'MonetaFindAccountByIdResponse',
			'FindAccountByAliasRequest' => 'MonetaFindAccountByAliasRequest',
			'FindAccountByAliasResponse' => 'MonetaFindAccountByAliasResponse',
			'FindAccountsListRequest' => 'MonetaFindAccountsListRequest',
			'FindAccountsListResponse' => 'MonetaFindAccountsListResponse',
			'GetAccountPaymentPasswordChallengeRequest' => 'MonetaGetAccountPaymentPasswordChallengeRequest',
			'GetAccountPaymentPasswordChallengeResponse' => 'MonetaGetAccountPaymentPasswordChallengeResponse',
			'CreateAccountRequestPaymentPassword' => 'MonetaCreateAccountRequestPaymentPassword',
			'CreateAccountRequest' => 'MonetaCreateAccountRequest',
			'CreateAccountResponse' => 'MonetaCreateAccountResponse',
			'EditAccountRequestPaymentPassword' => 'MonetaEditAccountRequestPaymentPassword',
			'EditAccountRequestOldPaymentPassword' => 'MonetaEditAccountRequestOldPaymentPassword',
			'EditAccountRequest' => 'MonetaEditAccountRequest',
			'EditAccountResponse' => 'MonetaEditAccountResponse',
			'GetOperationDetailsByIdRequest' => 'MonetaGetOperationDetailsByIdRequest',
			'GetOperationDetailsByIdResponse' => 'MonetaGetOperationDetailsByIdResponse',
			'FindOperationsListByCTIDRequestClientTransaction' => 'MonetaFindOperationsListByCTIDRequestClientTransaction',
			'FindOperationsListByCTIDRequest' => 'MonetaFindOperationsListByCTIDRequest',
			'FindOperationsListByCTIDResponse' => 'MonetaFindOperationsListByCTIDResponse',
			'FindOperationsListRequestFilter' => 'MonetaFindOperationsListRequestFilter',
			'FindOperationsListRequest' => 'MonetaFindOperationsListRequest',
			'FindOperationsListResponse' => 'MonetaFindOperationsListResponse',
			'FindLastOperationsListRequestTransactionsQuantity' => 'MonetaFindLastOperationsListRequestTransactionsQuantity',
			'FindLastOperationsListRequest' => 'MonetaFindLastOperationsListRequest',
			'FindLastOperationsListResponse' => 'MonetaFindLastOperationsListResponse',
			'FindProfileInfoByAccountIdRequest' => 'MonetaFindProfileInfoByAccountIdRequest',
			'FindProfileInfoByAccountIdResponse' => 'MonetaFindProfileInfoByAccountIdResponse',
			'CreateProfileRequest' => 'MonetaCreateProfileRequest',
			'CreateProfileResponse' => 'MonetaCreateProfileResponse',
			'EditProfileRequest' => 'MonetaEditProfileRequest',
			'EditProfileResponse' => 'MonetaEditProfileResponse',
			'GetProfileInfoRequest' => 'MonetaGetProfileInfoRequest',
			'GetProfileInfoResponse' => 'MonetaGetProfileInfoResponse',
			'FindProfileInfoRequestFilter' => 'MonetaFindProfileInfoRequestFilter',
			'FindProfileInfoRequest' => 'MonetaFindProfileInfoRequest',
			'FindProfileInfoResponse' => 'MonetaFindProfileInfoResponse',
			'FindProfileDocumentFilesRequest' => 'MonetaFindProfileDocumentFilesRequest',
			'FindProfileDocumentFilesResponse' => 'MonetaFindProfileDocumentFilesResponse',
			'UploadProfileDocumentFileRequest' => 'MonetaUploadProfileDocumentFileRequest',
			'UploadProfileDocumentFileResponse' => 'MonetaUploadProfileDocumentFileResponse',
			'FindProfileDocumentsRequest' => 'MonetaFindProfileDocumentsRequest',
			'FindProfileDocumentsResponse' => 'MonetaFindProfileDocumentsResponse',
			'CreateProfileDocumentRequest' => 'MonetaCreateProfileDocumentRequest',
			'CreateProfileDocumentResponse' => 'MonetaCreateProfileDocumentResponse',
			'EditProfileDocumentRequest' => 'MonetaEditProfileDocumentRequest',
			'EditProfileDocumentResponse' => 'MonetaEditProfileDocumentResponse',
			'FindAccountRelationsRequest' => 'MonetaFindAccountRelationsRequest',
			'FindAccountRelationsResponse' => 'MonetaFindAccountRelationsResponse',
			'GetAccountRelationRequest' => 'MonetaGetAccountRelationRequest',
			'GetAccountRelationResponse' => 'MonetaGetAccountRelationResponse',
			'SaveAccountRelationRequest' => 'MonetaSaveAccountRelationRequest',
			'SaveAccountRelationResponse' => 'MonetaSaveAccountRelationResponse',
			'DeleteAccountRelationRequest' => 'MonetaDeleteAccountRelationRequest',
			'DeleteAccountRelationResponse' => 'MonetaDeleteAccountRelationResponse',);
	
	/**
	 * SoapClient instance
	 * 
	 * @var SoapClient
	 */
	protected $client = null;
	
	/**
	 * An array of headers to be sent along with the SOAP request
	 * 
	 * @var array
	 */
	protected $inputHeaders = null;
	
	/**
	 * If supplied, this array will be filled with the headers from the SOAP response
	 * 
	 * @var array
	 */
	protected $outputHeaders = null;
	
	
	/**
	 * Constructor
	 *
	 * @param string $wsdl Path or URL to WSDL file
	 * @param array $options Options like SoapClient->__construct()
	 * 
	 * @return void
	 */
	function __construct($wsdl, $options = null)
	{		
		foreach(self::$classmap as $key => $value)
			if(!isset($options["classmap"][$key]))
				$options["classmap"][$key] = $value;
		
		if($options === null)
			$options = array();			
		
		$this->client = new SoapClient($wsdl, $options);
	}
	
	// Block of generated methods
	
	/**
	 * 
	 * 
	 * @param MonetaFindProfileDocumentsRequest $request
	 * 
	 * @return MonetaFindProfileDocumentsResponse
	 */
	public function FindProfileDocuments(MonetaFindProfileDocumentsRequest $request)
	{
		$request = array($request);
		return $this->call(__FUNCTION__, $request);
	}

	/**
	 * 
	 * 
	 * @param long $request
	 * 
	 * @return MonetaFindAccountByIdResponse
	 */
	public function FindAccountById( $request)
	{
		$request = array($request);
		return $this->call(__FUNCTION__, $request);
	}

	/**
	 * 
	 * 
	 * @param MonetaConfirmTransactionRequestType $request
	 * 
	 * @return MonetaOperationInfo
	 */
	public function ConfirmTransaction(MonetaConfirmTransactionRequestType $request)
	{
		$request = array($request);
		return $this->call(__FUNCTION__, $request);
	}

	/**
	 * 
	 * 
	 * @param MonetaFindProfileInfoRequest $request
	 * 
	 * @return MonetaFindProfileInfoResponse
	 */
	public function FindProfileInfo(MonetaFindProfileInfoRequest $request)
	{
		$request = array($request);
		return $this->call(__FUNCTION__, $request);
	}

	/**
	 * 
	 * 
	 * @param MonetaDeleteAccountRelationRequest $request
	 * 
	 * @return MonetaDeleteAccountRelationResponse
	 */
	public function DeleteAccountRelation(MonetaDeleteAccountRelationRequest $request)
	{
		$request = array($request);
		return $this->call(__FUNCTION__, $request);
	}

	/**
	 * 
	 * 
	 * @param MonetaCancelTransactionBatchRequestType $request
	 * 
	 * @return MonetaCancelTransactionBatchResponse
	 */
	public function CancelTransactionBatch(MonetaCancelTransactionBatchRequestType $request)
	{
		$request = array($request);
		return $this->call(__FUNCTION__, $request);
	}

	/**
	 * 
	 * 
	 * @param MonetaCreateProfileRequest $request
	 * 
	 * @return long
	 */
	public function CreateProfile(MonetaCreateProfileRequest $request)
	{
		$request = array($request);
		return $this->call(__FUNCTION__, $request);
	}

	/**
	 * 
	 * 
	 * @param MonetaTransactionBatchRequestType $request
	 * 
	 * @return MonetaTransferBatchResponse
	 */
	public function TransferBatch(MonetaTransactionBatchRequestType $request)
	{
		$request = array($request);
		return $this->call(__FUNCTION__, $request);
	}

	/**
	 * 
	 * 
	 * @param MonetaVerifyTransactionRequest $request
	 * 
	 * @return MonetaVerifyTransferResponseType
	 */
	public function VerifyTransaction(MonetaVerifyTransactionRequest $request)
	{
		$request = array($request);
		return $this->call(__FUNCTION__, $request);
	}

	/**
	 * 
	 * 
	 * @param MonetaGetAccountRelationRequest $request
	 * 
	 * @return MonetaGetAccountRelationResponse
	 */
	public function GetAccountRelation(MonetaGetAccountRelationRequest $request)
	{
		$request = array($request);
		return $this->call(__FUNCTION__, $request);
	}

	/**
	 * 
	 * 
	 * @param string $request
	 * 
	 * @return MonetaFindAccountByAliasResponse
	 */
	public function FindAccountByAlias( $request)
	{
		$request = array($request);
		return $this->call(__FUNCTION__, $request);
	}

	/**
	 * 
	 * 
	 * @param MonetaConfirmTransactionBatchRequestType $request
	 * 
	 * @return MonetaConfirmTransactionBatchResponse
	 */
	public function ConfirmTransactionBatch(MonetaConfirmTransactionBatchRequestType $request)
	{
		$request = array($request);
		return $this->call(__FUNCTION__, $request);
	}

	/**
	 * 
	 * 
	 * @param MonetaGetAccountPaymentPasswordChallengeRequest $request
	 * 
	 * @return MonetaGetAccountPaymentPasswordChallengeResponse
	 */
	public function GetAccountPaymentPasswordChallenge(MonetaGetAccountPaymentPasswordChallengeRequest $request)
	{
		$request = array($request);
		return $this->call(__FUNCTION__, $request);
	}

	/**
	 * 
	 * 
	 * @param MonetaFindAccountsListRequest $request
	 * 
	 * @return MonetaFindAccountsListResponse
	 */
	public function FindAccountsList(MonetaFindAccountsListRequest $request)
	{
		$request = array($request);
		return $this->call(__FUNCTION__, $request);
	}

	/**
	 * 
	 * 
	 * @param long $request
	 * 
	 * @return MonetaGetOperationDetailsByIdResponse
	 */
	public function GetOperationDetailsById( $request)
	{
		$request = array($request);
		return $this->call(__FUNCTION__, $request);
	}

	/**
	 * 
	 * 
	 * @param MonetaInvoiceRequest $request
	 * 
	 * @return MonetaTransactionResponseType
	 */
	public function Invoice(MonetaInvoiceRequest $request)
	{
		$request = array($request);
		return $this->call(__FUNCTION__, $request);
	}

	/**
	 * 
	 * 
	 * @param MonetaAccountRelation $request
	 * 
	 * @return MonetaSaveAccountRelationResponse
	 */
	public function SaveAccountRelation(MonetaAccountRelation $request)
	{
		$request = array($request);
		return $this->call(__FUNCTION__, $request);
	}

	/**
	 * 
	 * 
	 * @param MonetaCancelTransactionRequestType $request
	 * 
	 * @return MonetaCancelTransactionResponseType
	 */
	public function CancelTransaction(MonetaCancelTransactionRequestType $request)
	{
		$request = array($request);
		return $this->call(__FUNCTION__, $request);
	}

	/**
	 * 
	 * 
	 * @param MonetaDocument $request
	 * 
	 * @return MonetaCreateProfileDocumentResponse
	 */
	public function CreateProfileDocument(MonetaDocument $request)
	{
		$request = array($request);
		return $this->call(__FUNCTION__, $request);
	}

	/**
	 * 
	 * 
	 * @param MonetaUploadProfileDocumentFileRequest $request
	 * 
	 * @return MonetaUploadProfileDocumentFileResponse
	 */
	public function UploadProfileDocumentFile(MonetaUploadProfileDocumentFileRequest $request)
	{
		$request = array($request);
		return $this->call(__FUNCTION__, $request);
	}

	/**
	 * 
	 * 
	 * @param MonetaAuthoriseTransactionBatchRequestType $request
	 * 
	 * @return MonetaAuthoriseTransactionBatchResponse
	 */
	public function AuthoriseTransactionBatch(MonetaAuthoriseTransactionBatchRequestType $request)
	{
		$request = array($request);
		return $this->call(__FUNCTION__, $request);
	}

	/**
	 * 
	 * 
	 * @param MonetaFindLastOperationsListRequest $request
	 * 
	 * @return MonetaOperationInfoList
	 */
	public function FindLastOperationsList(MonetaFindLastOperationsListRequest $request)
	{
		$request = array($request);
		return $this->call(__FUNCTION__, $request);
	}

	/**
	 * 
	 * 
	 * @param MonetaFindAccountRelationsRequest $request
	 * 
	 * @return MonetaFindAccountRelationsResponse
	 */
	public function FindAccountRelations(MonetaFindAccountRelationsRequest $request)
	{
		$request = array($request);
		return $this->call(__FUNCTION__, $request);
	}

	/**
	 * 
	 * 
	 * @param MonetaTransactionRequestType $request
	 * 
	 * @return MonetaOperationInfo
	 */
	public function AuthoriseTransaction(MonetaTransactionRequestType $request)
	{
		$request = array($request);
		return $this->call(__FUNCTION__, $request);
	}

	/**
	 * 
	 * 
	 * @param MonetaEditAccountRequest $request
	 * 
	 * @return MonetaEditAccountResponse
	 */
	public function EditAccount(MonetaEditAccountRequest $request)
	{
		$request = array($request);
		return $this->call(__FUNCTION__, $request);
	}

	/**
	 * 
	 * 
	 * @param MonetaTransactionRequestType $request
	 * 
	 * @return MonetaForecastTransactionResponseType
	 */
	public function ForecastTransaction(MonetaTransactionRequestType $request)
	{
		$request = array($request);
		return $this->call(__FUNCTION__, $request);
	}

	/**
	 * 
	 * 
	 * @param MonetaTransactionRequestType $request
	 * 
	 * @return MonetaTransactionResponseType
	 */
	public function Transfer(MonetaTransactionRequestType $request)
	{
		$request = array($request);
		return $this->call(__FUNCTION__, $request);
	}

	/**
	 * 
	 * 
	 * @param MonetaFindProfileDocumentFilesRequest $request
	 * 
	 * @return MonetaFindProfileDocumentFilesResponse
	 */
	public function FindProfileDocumentFiles(MonetaFindProfileDocumentFilesRequest $request)
	{
		$request = array($request);
		return $this->call(__FUNCTION__, $request);
	}

	/**
	 * 
	 * 
	 * @param MonetaFindOperationsListByCTIDRequest $request
	 * 
	 * @return MonetaOperationInfoList
	 */
	public function FindOperationsListByCTID(MonetaFindOperationsListByCTIDRequest $request)
	{
		$request = array($request);
		return $this->call(__FUNCTION__, $request);
	}

	/**
	 * 
	 * 
	 * @param MonetaCreateAccountRequest $request
	 * 
	 * @return long
	 */
	public function CreateAccount(MonetaCreateAccountRequest $request)
	{
		$request = array($request);
		return $this->call(__FUNCTION__, $request);
	}

	/**
	 * 
	 * 
	 * @param MonetaGetProfileInfoRequest $request
	 * 
	 * @return MonetaProfile
	 */
	public function GetProfileInfo(MonetaGetProfileInfoRequest $request)
	{
		$request = array($request);
		return $this->call(__FUNCTION__, $request);
	}

	/**
	 * 
	 * 
	 * @param long $request
	 * 
	 * @return MonetaFindProfileInfoByAccountIdResponse
	 */
	public function FindProfileInfoByAccountId( $request)
	{
		$request = array($request);
		return $this->call(__FUNCTION__, $request);
	}

	/**
	 * 
	 * 
	 * @param MonetaDocument $request
	 * 
	 * @return MonetaEditProfileDocumentResponse
	 */
	public function EditProfileDocument(MonetaDocument $request)
	{
		$request = array($request);
		return $this->call(__FUNCTION__, $request);
	}

	/**
	 * 
	 * 
	 * @param MonetaRefundRequest $request
	 * 
	 * @return MonetaOperationInfo
	 */
	public function Refund(MonetaRefundRequest $request)
	{
		$request = array($request);
		return $this->call(__FUNCTION__, $request);
	}

	/**
	 * 
	 * 
	 * @param MonetaFindOperationsListRequest $request
	 * 
	 * @return MonetaOperationInfoList
	 */
	public function FindOperationsList(MonetaFindOperationsListRequest $request)
	{
		$request = array($request);
		return $this->call(__FUNCTION__, $request);
	}

	/**
	 * 
	 * 
	 * @param MonetaTransactionRequestType $request
	 * 
	 * @return MonetaVerifyTransferResponseType
	 */
	public function VerifyTransfer(MonetaTransactionRequestType $request)
	{
		$request = array($request);
		return $this->call(__FUNCTION__, $request);
	}

	/**
	 * 
	 * 
	 * @param MonetaEditProfileRequest $request
	 * 
	 * @return MonetaEditProfileResponse
	 */
	public function EditProfile(MonetaEditProfileRequest $request)
	{
		$request = array($request);
		return $this->call(__FUNCTION__, $request);
	}

	// end of block
	

	/**
	 * Add header to array of headers to be sent along with the SOAP request.  
	 * 
	 * @param mixed $header Заголовок
	 * 
	 * @return void
	 */
	public function addInputHeader($header)
	{
		$this->inputHeaders[] = $header;
	}
	
	/**
	 * If supplied, this array will be filled with the headers from the SOAP response
	 * 
	 * @return array
	 */
	public function getOutputHeaders()
	{
		return $this->outputHeaders;
	}
	

	/**
	 * Call method of web-service
	 * 
	 * @param string $method Method name
	 * @param mixed $data Data 
	 * @param mixed $options Options corresponding like SoapClient->__soapCall() 
	 * 
	 * @return mixed
	 */
	protected function call($method, $data, $options = null)
	{
		return $this->client->__soapCall($method, $data, $options, $this->inputHeaders, $this->outputHeaders);
	}
}
?>